package groot.dozer.common;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.Document;

/**
 * Document工厂类
 * @author Groot
 * @since 2018/11/7 13:36
 */
public class DocumentFactory {

  private static DocumentBuilder builder;

  static{
    DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
    try {
      builder = factory.newDocumentBuilder();
    } catch (ParserConfigurationException e) {
      e.printStackTrace();
    }
  }

  public static Document getInstance(){
    return builder.newDocument();
  }
}
